﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;

namespace Icoders.MarketTracker.Web.Lib.Security
{
    public class CustomPrincipal : IPrincipal
    {
        private CustomIdentity _cIdentity;

        public CustomPrincipal(CustomIdentity cIdentity)
        {
            _cIdentity = cIdentity;
        }

        public bool IsInRole(string role)
        {
            return _cIdentity.Roles.Contains(role);
        }

        public IIdentity Identity
        {
            get { return _cIdentity; }
        }
    }
}
